<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Path and motion planning</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../index.html" TARGET="_top"><img src="images/homeImg.png"></a></p>



<h1>Path and motion planning</h1>

<p>CoppeliaSim offers path/motion planning functionality via a plugin wrapping the <a href="http://ompl.kavrakilab.org/">OMPL library</a>. The plugin is courtesy of Federico Ferri.</p>

<p>Following points should be considered when preparing a path/motion planning task:</p>

<li>Decide of a start and goal state. When the path planning object is a serial manipulator, a goal pose (or end-effector position/orientation) is often provided instead of a goal state. In that case function <a href="regularApi/simGetConfigForTipPose.htm">sim.getConfigForTipPose</a> can be used to find one or several goal states that satisfy the provided goal pose.</li>
<li>Create a path planning task with <a href="omplApi.htm#createTask">simOMPL.createTask</a>.</li>
<li>Select an algorithm with <a href="omplApi.htm#setAlgorithm">simOMPL.setAlgorithm</a>.</li>
<li>Create the required state space, which can be composed as a compound object: <a href="omplApi.htm#createStateSpace">simOMPL.createStateSpace</a> and <a href="omplApi.htm#setStateSpace">simOMPL.setStateSpace</a>.</li>
<li>Specify which entities are not allowed to collide with <a href="omplApi.htm#setCollisionPairs">simOMPL.setCollisionPairs</a>.</li>
<li>Specify the start and goal state with <a href="omplApi.htm#setStartState">simOMPL.setStartState</a> and <a href="omplApi.htm#setGoalState">simOMPL.setGoalState</a>.</li>
<li>Compute one or several paths with <a href="omplApi.htm#compute">simOMPL.compute</a>.</li>
<li>Destroy the path planning task with <a href="omplApi.htm#destroyTask">simOMPL.destroyTask</a>.</li>
<li>Often, path planning is used in combination with inverse kinematics: in a pick-and-place task for instance, the final approach should usually be a straight-line path, which can be generated with <a href="regularApi/simGenerateIkPath.htm">sim.generateIkPath</a>.</li>

<p>Above procedure is the <em>regular</em> approach, which sometimes lacks flexibility. Additionally, following callback functions can be set-up:</p>

<li><a href="omplApi.htm#setStateValidationCallback">simOMPL.setStateValidationCallback</a></li>
<li><a href="omplApi.htm#setProjectionEvaluationCallback">simOMPL.setProjectionEvaluationCallback</a></li>
<li><a href="omplApi.htm#setGoalCallback">simOMPL.setGoalCallback</a></li>

<p>The path provided by <a href="omplApi.htm#compute">simOMPL.compute</a> is usually just one path among an infinite number of other possible paths, and there is no guarantee that the returned path is the optimal solution. For that reason it is common to compute several different paths, then to select the better one (e.g. the shorter one).</p>

<p>In a similar way, if the goal state had to be computed from a goal pose, then several goal states are usually tested, since not all goal states might be reachable or close enough (in terms of state space distance). A common practice is to first find several goal states, then order them according their state space distance to the start state. Then perform path planning calculations to the closest goal state, then to the next closest goal state, etc., until a satisfactory path was found.</p>

<p>Make sure to refer to following demo scenes for additional details:</p>

<li><em>scenes/ik_fk_simple_examples/8-computingJointAnglesForRandomPoses.ttt</em></li>
<li><em>scenes/3DoFHolonomicPathPlanning.ttt</em></li>
<li><em>scenes/6DoFHolonomicPathPlanning.ttt</em></li>
<li><em>motionPlanningDemo1</em></li>
<li><em>motionPlanningAndGraspingDemo.ttt</em></li>

<br>
<h3 class=recommendedTopics>Recommended topics</h3>
<li><a href="omplApi.htm">The OMPL plugin API functions</a></li>

<br>
<br>
 </tr>
</table> 
</div>  
  
  
</body>

</html>
